/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS  
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). 
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.  
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR  
 * COPYRIGHT LAW IS PROHIBITED.
 * 
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND  
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE  
 * MAY BE CONSIDERED TO BE A CONTRACT,
 * THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED 
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 * 
 */
package com.lineage.server.templates;

import java.util.Calendar;

/**
 * Class <code>L1Castle</code> 数据库模版:城堡.
 * 
 * @author jrwz
 * @version 2012-6-16上午05:18:01
 * @see com.lineage.server.templates
 * @since JDK1.7
 */
public final class L1Castle {

    /** 城堡编号. */
    private final int castleId;
    /** 城堡名称. */
    private final String castleName;
    /** 城战时间. */
    private Calendar warTime;
    /** 城堡税率. */
    private int taxRate;
    /** 城堡公共资金. */
    private int publicMoney;

    /**
     * 数据库模版:城堡.
     * 
     * @param id
     *            城堡编号
     * @param name
     *            城堡名称
     */
    public L1Castle(final int id, final String name) {
        this.castleId = id;
        this.castleName = name;
    }

    /**
     * 取得城堡编号.
     * 
     * @return 城堡编号
     */
    public int getId() {
        return this.castleId;
    }

    /**
     * 取得城堡名称.
     * 
     * @return 城堡名称
     */
    public String getName() {
        return this.castleName;
    }

    /**
     * 取得城堡公共资金.
     * 
     * @return 城堡公共资金
     */
    public int getPublicMoney() {
        if (this.publicMoney < 0) {
            return 0;
        }
        return this.publicMoney;
    }

    /**
     * 取得城堡税率.
     * 
     * @return 城堡税率
     */
    public int getTaxRate() {
        return this.taxRate;
    }

    /**
     * 取得城战时间.
     * 
     * @return 城战时间
     */
    public Calendar getWarTime() {
        return this.warTime;
    }

    /**
     * 设置城堡公共资金.
     * 
     * @param i
     *            城堡公共资金
     */
    public void setPublicMoney(final int i) {
        this.publicMoney = i;
    }

    /**
     * 设置城堡税率.
     * 
     * @param i
     *            城堡税率
     */
    public void setTaxRate(final int i) {
        this.taxRate = i;
    }

    /**
     * 设置城战时间.
     * 
     * @param i
     *            城战时间
     */
    public void setWarTime(final Calendar i) {
        this.warTime = i;
    }
}
